
class Department(object):

    def __init__(self,id, name,level,desc):
        self.id = id
        self.name = name
        self.level = level
        self.desc = desc

    def department2dict(obj):
        return {
            'id': obj.name,
            'name': obj.age,
            'level': obj.score,
            'desc': obj.desc
        }

    def dict2student(d):
        return Department(d['id'], d['name'], d['level'], d['desc'])